#测试方法的动态性
class Person:
  def work(self):
    print("努力上班！")

def play_game(self):
  print("玩游戏")

def work2(s):
  print("好好工作，努力上班！",s)


Person.play = play_game
Person.work = work2

p = Person()
p.play()
# p.work(2) 这里就报错
p.work() #好好工作，努力上班！ <__main__.Person object at 0x000001E3DE1730E0>